<template>
<div class="land-classify">
  <div class='layer-container'>
    <div class='detail-header'>
      <div class='title-box'>长沙市土地现状分类情况</div>
      <div class='title-btn' :class='{extend:!isFold, fold: isFold}' @click='isFold=!isFold'></div>
    </div>
    <div class='detail-content' v-show='isFold'>
      <div class='total-header'>
        <div class='total-text'>全域国土面积：</div>
        <div class='total-value'>1181613.50<span>公顷</span></div>
      </div>
      <div class="detail-table">
        <table class="detail-tbe">
          <tr class="detail-tbe-head">
            <th></th>
            <th>三调</th>
            <th>2020变更调查</th>
            <th>差值</th>
          </tr>
        </table>
        <div class="detail-tbe-scroll">
          <table class="detail-tbe detail-tbe-sub">
            <tr class="detail-tbe-body" v-for="item in landClassifyData" :key="item.id">
              <td class="detail-tbeb-name">{{ item.name }}</td>
              <td class="detail-tbeb-big">{{ item.three }}</td>
              <td class="detail-tbeb-big">{{ item.survey }}</td>
              <td class="detail-tbeb-samll">{{ item.difference }}</td>
            </tr>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script lang='ts'>
import { Component, Vue, Prop } from 'vue-property-decorator'

@Component({
  name: 'LandClassify',
  components: {
    LandClassify
  }
})

export default class LandClassify extends Vue{
  @Prop() year!: string
  private isFold = true
  private landClassifyData:any = [
    {name: '湿地', id: 'sd', three: 2550.70, survey: 2558.40, difference: 7.7},
    {name: '耕地', id: 'gd', three: 208785.55, survey: 207936.37, difference: -849.18},
    {name: '种植园用地', id: 'zzyyd', three: 28503.15, survey: 28883.62, difference: 380.47},
    {name: '林地', id: 'ld', three: 640086.91, survey: 638518.04, difference: -1568.87},
    {name: '草地', id: 'cd', three: 4742.71, survey: 4903.44, difference: 160.73},
    {name: '商业服务业用地', id: 'syfwyd', three: 8575.45, survey: 8791.78, difference: 216.33},
    {name: '工矿用地', id: 'gkyd', three: 25345.11, survey: 25961.54, difference: 616.43},
    {name: '住宅用地', id: 'zzyd', three: 99999.25, survey: 99835.22, difference: -164.03},
    {name: '公共管理与公共服务用地', id: 'ggglyggfwyd', three: 13438.42, survey: 13717.32, difference: 278.9},
    {name: '特殊用地', id: 'tsyd', three: 2905.29, survey: 2954.59, difference: 49.3},
    {name: '交通运输用地', id: 'jtysyd', three: 47162.57, survey: 47860.22, difference: 697.65},
    {name: '水域及水利设施用地', id: 'syjslssyd', three: 85023.32, survey: 85073.39, difference: 50.07},
    {name: '其他土地', id: 'qttd', three: 14495.07, survey: 14619.57, difference: 124.5}
  ]
}
</script>

<style scoped lang='scss'>
.layer-container {
  //background: linear-gradient(180.00deg, rgba(0, 33, 96, 0.9) 0%, rgba(0, 33, 96, 0.7) 100%);
  background: url('~@/assets/cockpit/land-classify-bg.png') no-repeat 0/ 100% 100%;
  .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 12px 16px;
    .title-box {
      color: #bffeff;
      &:before {
        display: inline-block;
        content: '';
        width: 24px;
        height: 24px;
        vertical-align: middle;
        background: url('~@/assets/cockpit/cho-light.png') no-repeat 0/100% 100%;
      }
    }
    .title-btn {
      position: relative;
      width: 24px;
      height: 24px;
      background: linear-gradient(360.00deg, rgba(0, 149, 255, 0.3) 0%, rgba(0, 149, 255, 0) 100%);
      border-radius: 50%;
      cursor: pointer;
      &.extend {
        &:after {
          display: block;
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: url('~@/assets/cockpit/cho-up-extend.png') no-repeat 0/100% 100%;
        }
      }
      &.fold{
        &:after {
          display: block;
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: url('~@/assets/cockpit/cho-down-fold.png') no-repeat 0/100% 100%;
        }
      }
    }
  }
  .detail-content {
    .total-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: relative;
      padding: 0 12px;
      color: #fff;
      &:after {
        display: block;
        content: '';
        position: absolute;
        left: 18px;
        top: 10px;
        z-index: -1;
        height: 10px;
        width: calc(100% - 24px);
        background: linear-gradient(90.00deg, #006aff 0%, rgba(0, 106, 255, 0) 100%);
        opacity: 0.5;
      }
      .total-text {
        position: relative;
        padding-left: 6px;
        &:before{
          display: block;
          content: '';
          position: absolute;
          left: 0;
          top: 3px;
          width: 2px;
          height: 12px;
          background: #00eaff;
        }
      }
      .total-value {
        font-size: 24px !important;
      }
    }
    
  }
}
.detail-table {
  padding: 12px;
  .detail-tbe {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0px 4px;
    text-align: right;
    .detail-tbe-head {
      background: rgba(#fff, .15);
      th {
        padding: 4px 12px;
        font-size: 12px !important;
        color: #BFFEFF;
        font-weight: 400;
        &:first-child {
          text-align: left;
        }
        &:nth-child(1) {
          width: 30%;
        }
        &:nth-child(2) {
          width: 25%;
        }
        &:nth-child(3) {
          width: 25%;
        }
        &:nth-child(4) {
          width: 20%;
        }
      }
    }
    .detail-tbe-body {
      height: 28px;
      background: rgba(#fff, .05);
      td {
        padding: 4px 6px;
      }
      .detail-tbeb-name {
        width: 30%;
        font-size: 12px !important;
        color: #00EAFF;
        text-align: left;
      }
      .detail-tbeb-big {
        width: 25%;
        font-size: 14px !important;
        color: #fff;
      }
      .detail-tbeb-samll {
        width: 20%;
        font-size: 12px !important;
        color: #fff;
      }
    }
  }
  .detail-tbe-scroll {
    height: 225px;
    overflow-y: auto;
    &::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }
    &::-webkit-scrollbar-thumb {
      //滑块
      height: 4px;
      border-top: none;
      border-bottom: none;
      border: 2px solid transparent;
      background: rgba(#fff, .7);
      background-clip: padding-box;
      border-radius: 6px;
    }
    &::-webkit-scrollbar-track {
      //轨道
      background: #002160 !important;
    }
    &::-webkit-scrollbar-track-piece {
      //轨道
      background: #002160 !important;
    }
  }
}
</style>
